The following table presents all namespaces used in this document.
ontouml | <https://w3id.org/ontouml#> |
w3id | <https://w3id.org> |
dct | <http://purl.org/dc/terms> |
owl | <http://www.w3.org/2002/07/owl> |
rdf | <http://www.w3.org/1999/02/22-rdf-syntax-ns> |
xml | <http://www.w3.org/XML/1998/namespace> |
xsd | <http://www.w3.org/2001/XMLSchema> |
rdfs | <http://www.w3.org/2000/01/rdf-schema> |
dcat | <http://www.w3.org/ns/dcat> |
vann | <http://purl.org/vocab/vann> |
foaf | <http://xmlns.com/foaf/0.1> |
The OntoUML Vocabulary's data model was structured to be in conformance with the OntoUML Metamodel.
It is important to emphasize that the OntoUML Metamodel is implementation-independent. When building the Vocabulary, an OWL artifact, the building language's constraints will restrict the generated artifact. In this sense, design decisions had to be made in order to generate the OntoUML Vocabulary. The adopted design decisions are registered as comments in the vocabulary's related concepts.
Being grounded on an explicit implementation-independent metamodel benefits OntoUML Vocabulary, in the sense that a mapping between these two artifacts is already stablished, facilitating future integration and data exchange to other implementations based on the OntoUML Metamodel.
All OntoUML modeling elements are represented in the Metamodel's abstract syntax, which can be visualized in the following diagram.
The modeling elements are the ones that carry information about the domain being represented, not about the visual representation itself. The gray color represents the diagram's main concrete classes.
The Metamodel's concrete syntax contains all diagramatic elements that are part of an OntoUML model. These elements are displayed in the diagram below.
The diagramatical representation are the views and shapes that forms the visual representation of the modeling elements. Every modeling element that can be visualized in a diagram has its corresponding view and shape. The gray color represents the diagram's concrete classes.
This section provides a comprehensive overview of the content that users will encounter when working with a graph that adheres to the OntoUML Vocabulary.
In this section's examples, we will use an OntoUML model created at the Visual Paradigm model editor using the ontouml-vp-plugin and exported to an OntoUML Schema-compliant JSON file. We depict the example model below:
The transformation from JSON to graph was performed using the OntoUML JSON2Graph Decoder tool. For a better presentation, the JSON file objects' IDs were manually reduced to create the TTL examples.
This example is composed of the following files, which are made available to users:
MyExample.vpp
: OntoUML model editable file.MyClassDiagram.png
: Exported image of the created
OntoUML model.MyExample.json
: OntoUML model exported as JSON.MyExample.ttl
: OntoUML model exported as a graph in
Turtle syntax (.ttl
).All code snippets in this section will be presented using the Turtle syntax. Besides the necessary RDF, RDFS, and OWL prefixes, we employ the following ones in this section's examples. However, we omitted them in both the Turtle and SPARQL code representations for the sake of brevity.
@prefix : <https://example.org#> .
@prefix ontouml: <https://w3id.org/ontouml#> .
The examples have been categorized into four groups: Projects and Diagrams, Model Elements, Views, and Shapes.
In a regular use case, a model is transformed by a computational tool into an OntoUML Vocabulary-compliant graph. Even though this process is done automatically by a computational tool without human intervention, the manipulation of the resulting graph is important for its diverse possibilities of use.
The following code examples aim to illustrate the structure of each
OntoUML entity when represented in the OntoUML Vocabulary format.
Each code snippet provided here encompasses an example of a single
entity produced through the JSON-to-graph transformation process.
The unique exception is the Note
entity, which is
supported by the OntoUML Vocabulary but not by the exportation
feature of the ontouml-vp-plugin version 0.5.3.
:XCY a ontouml:Project ;
ontouml:diagram :NyB ;
ontouml:model :XCY_root ;
ontouml:name "MyExample"@en .
:NyB a ontouml:Diagram ;
ontouml:containsView :DUa, :M9S, :gtP;
ontouml:name "MyClassDiagram"@en ;
ontouml:owner :yHW ;
ontouml:project :XCY .
Other containsView properties omitted for brevity.
:L71_cardinality a ontouml:Cardinality ;
ontouml:cardinalityValue "1..*" ;
ontouml:lowerBound "1" ;
ontouml:upperBound "*" .
:Ljp a ontouml:Class ;
ontouml:attribute :nf0, :xrq ;
ontouml:description "A Person is a human." ;
ontouml:isAbstract false ;
ontouml:isDerived false ;
ontouml:isPowertype false ;
ontouml:name "Person"@en ;
ontouml:order "1"^^xsd:nonNegativeInteger ;
ontouml:project :XCY ;
ontouml:restrictedTo ontouml:functionalComplexNature ;
ontouml:stereotype ontouml:kind .
:fGD a ontouml:Generalization ;
ontouml:general :Ljp ;
ontouml:specific :uNZ ;
ontouml:project :XCY .
:HNP a ontouml:GeneralizationSet ;
ontouml:generalization :DzD, :fGD ;
ontouml:isComplete true ;
ontouml:isDisjoint true ;
ontouml:name "PersonGS"@en ;
ontouml:project :XCY .
:myi a ontouml:Package ;
ontouml:containsModelElement :L7a, :R24 ;
ontouml:name "My2ndPackage"@en ;
ontouml:project :XCY .
:nf0 a ontouml:Property ;
ontouml:aggregationKind ontouml:none ;
ontouml:cardinality :nf0_cardinality ;
ontouml:isDerived false ;
ontouml:isOrdered false ;
ontouml:isReadOnly false ;
ontouml:name "age"@en ;
ontouml:propertyType :vCY ;
ontouml:project :XCY .
:L7a a ontouml:Relation ;
ontouml:description "Every material association is derived." ;
ontouml:isAbstract false ;
ontouml:isDerived true ;
ontouml:name "studiesIn"@en ;
ontouml:relationEnd :L71, :L78 ;
ontouml:sourceEnd :L71 ;
ontouml:stereotype ontouml:material ;
ontouml:targetEnd :L78 ;
ontouml:project :XCY .
:zx5 a ontouml:ClassView ;
ontouml:isViewOf :Lx5 ;
ontouml:project :XCY ;
ontouml:shape :zx5_shape .
:gtP a ontouml:GeneralizationSetView ;
ontouml:isViewOf :HNP ;
ontouml:project :XCY ;
ontouml:shape :gtP_shape .
:rzD a ontouml:GeneralizationView ;
ontouml:isViewOf :DzD ;
ontouml:project :XCY ;
ontouml:shape :rzD_path ;
ontouml:sourceView :Ljw ;
ontouml:targetView :zx5 .
:M9S a ontouml:RelationView ;
ontouml:isViewOf :Kzi ;
ontouml:project :XCY ;
ontouml:shape :M9S_path ;
ontouml:sourceView :ppw ;
ontouml:targetView :Ljw .
:M9S_path a ontouml:Path ;
ontouml:point :M9S_path_point_0, :M9S_path_point_1 ;
ontouml:project :XCY .
:M9S_path_point_0 a ontouml:Point ;
ontouml:xCoordinate 153 ;
ontouml:yCoordinate 196 .
:ppw_shape a ontouml:Rectangle ;
ontouml:topLeftPosition :ppw_shape_point ;
ontouml:height "40"^^xsd:positiveInteger ;
ontouml:width "80"^^xsd:positiveInteger ;
ontouml:project :XCY .
:gtP_shape a ontouml:Text ;
ontouml:height "45"^^xsd:positiveInteger ;
ontouml:project :XCY ;
ontouml:text "" ;
ontouml:topLeftPosition :gtP_shape_point ;
ontouml:width "65"^^xsd:positiveInteger .
Once the serialized model is available, a user must know how to access its entities and their properties to acquire the necessary data for processing. The manipulation can be done by using computational RDF-based graphs manipulation libraries, like Python's RDFLib or Java's Apache JENA, or by using the SPARQL Query Language, a W3C Recommendation.
The following commented SPARQL queries intend to serve as examples of how users can access some of the most useful model's pieces of data. All SPARQL queries and their results are presented in tables.
In this first query, we aim to identify all individuals of type ontouml:Class (which are different from the
owl:Class individuals). When serializing a model using the OntoUML
Vocabulary, we do the identification of every entity through generic
IDs. In this example, we aim at returning the IDs of individuals of
type ontouml:Class (class_id
in
this section's examples), and their corresponding name (class_name
)
and stereotype (class_stereotype
). These properties can
be accessed via ontouml:name and ontouml:stereotype,
respectively.
SPARQL Query | Query Results | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
In this example, besides classes' information, we also want to access the OntoUML Relations (associations, aggregations, and compositions) that have classes in their source or target ends.
To do this, we identify each ontouml:class
(as done in Query 1), but also identify each ontouml:relation
(rel_id
) and their association ends. The association
ends can be identified using the ontouml:relationEnd
property, which comprises (i.e., it is the super property of) both
the source and target ends (to access these specific properties it
is necessary to use the ontouml:sourceEnd
or ontouml:targetEnd properties). The
relations' stereotypes (rel_stereotype
) are accessed
via ontouml:stereotype property.
To get the relations to the classes to which they are associated, we need to verify which of the relation ends have as type the classes' IDs. This is done via ontouml:propertyType property.
SPARQL Query | Query Results | ||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
Note that the query's answer shows that some classes have a single association (e.g., the 'Brain' class is only related to the 'Person' class) and that other classes have multiple associated relations (e.g., the 'Enrolment' class). This result corresponds to what is depicted in the used example.
Every OntoUML Class has in common the following attributes: isAbstract (boolean), isDerived (boolean), order (nonNegativeInteger), isPowertype (boolean). These values for each class are easily accessible via the properties ontouml:isAbstract, ontouml:isDerived, ontouml:order, and ontouml:isPowertype, respectively.
SPARQL Query | Query Results | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
Note that an ontouml:order with value '0' corresponds to an OntoUML model class's order of value '*'. I.e., it is the representation of 'orderless' classes.
Diagrams (with ID diagram_id
and name diagram_name
)
and OntoUML model elements can be related via these elements' views.
In this query we are interested in filtering only the classes'
representations, hence, we first identify all views of diagrams
using the ontouml:containsView property
and restrict this result by selecting only the classes views (i.e.,
the views that have the ontouml:isViewOf
property with an element of type ontouml:Class).
SPARQL Query | Query Results | ||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
As seen in the query result table, all classes are depicted in the same diagram because our example comprises a model with a single diagram.
Finally, in this last example, we aim to identify OntoUML Classes that are not represented in any diagram. Using a similar strategy to the one adopted in Query 4, we need to access the information about classes' views and their relations with diagrams. However, in this case, we need to filter out the views that are associated with classes.
SPARQL Query | Query Results | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|
The query results table shows that only two classes are not represented in any diagram and that both of them have stereotype ontouml:datatype.
IRI: https://w3id.org/ontouml#AggregationKind
IRI: https://w3id.org/ontouml#Cardinality
IRI: https://w3id.org/ontouml#Class
IRI: https://w3id.org/ontouml#Classifier
IRI: https://w3id.org/ontouml#ClassStereotype
IRI: https://w3id.org/ontouml#ClassView
IRI: https://w3id.org/ontouml#ConnectorView
IRI: https://w3id.org/ontouml#DecoratableElement
IRI: https://w3id.org/ontouml#Diagram
IRI: https://w3id.org/ontouml#DiagramElement
IRI: https://w3id.org/ontouml#ElementView
IRI: https://w3id.org/ontouml#Generalization
IRI: https://w3id.org/ontouml#GeneralizationSet
IRI: https://w3id.org/ontouml#GeneralizationSetView
IRI: https://w3id.org/ontouml#GeneralizationView
IRI: https://w3id.org/ontouml#Literal
IRI: https://w3id.org/ontouml#ModelElement
IRI: https://w3id.org/ontouml#NodeView
IRI: https://w3id.org/ontouml#Note
IRI: https://w3id.org/ontouml#NoteView
IRI: https://w3id.org/ontouml#OntologicalNature
IRI: https://w3id.org/ontouml#OntoumlElement
IRI: https://w3id.org/ontouml#Package
IRI: https://w3id.org/ontouml#PackageView
IRI: https://w3id.org/ontouml#Path
IRI: https://w3id.org/ontouml#Point
IRI: https://w3id.org/ontouml#Project
IRI: https://w3id.org/ontouml#Property
IRI: https://w3id.org/ontouml#PropertyStereotype
IRI: https://w3id.org/ontouml#Rectangle
IRI: https://w3id.org/ontouml#RectangularShape
IRI: https://w3id.org/ontouml#Relation
IRI: https://w3id.org/ontouml#RelationStereotype
IRI: https://w3id.org/ontouml#RelationView
IRI: https://w3id.org/ontouml#Shape
IRI: https://w3id.org/ontouml#Stereotype
IRI: https://w3id.org/ontouml#Text
IRI: https://w3id.org/ontouml#aggregationKind
IRI: https://w3id.org/ontouml#attribute
IRI: https://w3id.org/ontouml#cardinality
IRI: https://w3id.org/ontouml#categorizer
IRI: https://w3id.org/ontouml#containsModelElement
IRI: https://w3id.org/ontouml#containsView
IRI: https://w3id.org/ontouml#diagram
IRI: https://w3id.org/ontouml#general
IRI: https://w3id.org/ontouml#generalization
IRI: https://w3id.org/ontouml#isViewOf
IRI: https://w3id.org/ontouml#literal
IRI: https://w3id.org/ontouml#model
IRI: https://w3id.org/ontouml#owner
IRI: https://w3id.org/ontouml#point
IRI: https://w3id.org/ontouml#project
IRI: https://w3id.org/ontouml#property
IRI: https://w3id.org/ontouml#propertyType
IRI: https://w3id.org/ontouml#redefinesProperty
IRI: https://w3id.org/ontouml#relationEnd
IRI: https://w3id.org/ontouml#restrictedTo
IRI: https://w3id.org/ontouml#shape
IRI: https://w3id.org/ontouml#sourceEnd
IRI: https://w3id.org/ontouml#sourceView
IRI: https://w3id.org/ontouml#specific
IRI: https://w3id.org/ontouml#stereotype
IRI: https://w3id.org/ontouml#subsetsProperty
IRI: https://w3id.org/ontouml#targetEnd
IRI: https://w3id.org/ontouml#targetView
IRI: https://w3id.org/ontouml#topLeftPosition
IRI: https://w3id.org/ontouml#cardinalityValue
IRI: https://w3id.org/ontouml#description
IRI: https://w3id.org/ontouml#height
IRI: https://w3id.org/ontouml#isAbstract
IRI: https://w3id.org/ontouml#isComplete
IRI: https://w3id.org/ontouml#isDerived
IRI: https://w3id.org/ontouml#isDisjoint
IRI: https://w3id.org/ontouml#isExtensional
IRI: https://w3id.org/ontouml#isOrdered
IRI: https://w3id.org/ontouml#isPowertype
IRI: https://w3id.org/ontouml#isReadOnly
IRI: https://w3id.org/ontouml#lowerBound
IRI: https://w3id.org/ontouml#name
IRI: https://w3id.org/ontouml#order
IRI: https://w3id.org/ontouml#upperBound
IRI: https://w3id.org/ontouml#width
IRI: https://w3id.org/ontouml#abstract
IRI: https://w3id.org/ontouml#abstractNature
IRI: https://w3id.org/ontouml#begin
IRI: https://w3id.org/ontouml#bringsAbout
IRI: https://w3id.org/ontouml#category
IRI: https://w3id.org/ontouml#characterization
IRI: https://w3id.org/ontouml#collective
IRI: https://w3id.org/ontouml#collectiveNature
IRI: https://w3id.org/ontouml#comparative
IRI: https://w3id.org/ontouml#componentOf
IRI: https://w3id.org/ontouml#composite
IRI: https://w3id.org/ontouml#creation
IRI: https://w3id.org/ontouml#datatype
IRI: https://w3id.org/ontouml#derivation
IRI: https://w3id.org/ontouml#end
IRI: https://w3id.org/ontouml#enumeration
IRI: https://w3id.org/ontouml#event
IRI: https://w3id.org/ontouml#eventNature
IRI: https://w3id.org/ontouml#externalDependence
IRI: https://w3id.org/ontouml#extrinsicModeNature
IRI: https://w3id.org/ontouml#functionalComplexNature
IRI: https://w3id.org/ontouml#historicalDependence
IRI: https://w3id.org/ontouml#historicalRole
IRI: https://w3id.org/ontouml#historicalRoleMixin
IRI: https://w3id.org/ontouml#instantiation
IRI: https://w3id.org/ontouml#intrinsicModeNature
IRI: https://w3id.org/ontouml#kind
IRI: https://w3id.org/ontouml#manifestation
IRI: https://w3id.org/ontouml#material
IRI: https://w3id.org/ontouml#mediation
IRI: https://w3id.org/ontouml#memberOf
IRI: https://w3id.org/ontouml#mixin
IRI: https://w3id.org/ontouml#mode
IRI: https://w3id.org/ontouml#none
IRI: https://w3id.org/ontouml#participation
IRI: https://w3id.org/ontouml#participational
IRI: https://w3id.org/ontouml#phase
IRI: https://w3id.org/ontouml#phaseMixin
IRI: https://w3id.org/ontouml#quality
IRI: https://w3id.org/ontouml#qualityNature
IRI: https://w3id.org/ontouml#quantity
IRI: https://w3id.org/ontouml#quantityNature
IRI: https://w3id.org/ontouml#relator
IRI: https://w3id.org/ontouml#relatorNature
IRI: https://w3id.org/ontouml#role
IRI: https://w3id.org/ontouml#roleMixin
IRI: https://w3id.org/ontouml#situation
IRI: https://w3id.org/ontouml#situationNature
IRI: https://w3id.org/ontouml#subCollectionOf
IRI: https://w3id.org/ontouml#subkind
IRI: https://w3id.org/ontouml#subQuantityOf
IRI: https://w3id.org/ontouml#termination
IRI: https://w3id.org/ontouml#triggers
IRI: https://w3id.org/ontouml#type
IRI: https://w3id.org/ontouml#typeNature
The authors would like to thank Silvio Peroni for developing LODE, a Live OWL Documentation Environment, which is used for representing the Cross Referencing Section of this document and Daniel Garijo for developing Widoco, the program used to create the template used in this documentation.